π§ͺ test(dashboard): cover breaker-state, governor-watchdog, providers-headroom, and repo-cost handlers - #4931
Conversation
β¦providers-headroom, and repo-cost handlers Four dashboard API handlers had 0% coverage. This adds handler-level tests in pkg/dashboard/api_state_readouts_test.go: - handleBreakerState (GET /api/breaker): 0% -> 100% - handleGovernorWatchdog (PUT /api/config/governor/watchdog): 0% -> 96.9% including validation rejections and the legacy Enabled-flag clearing - handleProvidersHeadroom (GET /api/providers/headroom): 0% -> 83.3% - handleRepoCost (GET /api/repo-cost) + auditPathForActivity: 0% -> 87.5%/66.7% Test-only change; no production code touched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <sec-check@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but does not touch If it is user-visible β a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Test Improvement
Adds
src/pkg/dashboard/api_state_readouts_test.gocovering four dashboard API handlers that had 0% coverage:handleBreakerStatehandleGovernorWatchdogEnabled-flag clearing + partial updates)handleProvidersHeadroomhandleRepoCost/auditPathForActivityvalidateGovernorWatchdogalso reaches 100%.Claimed ground
Exactly the four handlers above in
pkg/dashboard(filesapi.go,api_governor_watchdog.go,api_providers_headroom.go,repo_cost.goβ tests only, one new test file). Disjoint from open hold PRs #4923 (cmd/bd), #4905 (cmd/hive main.go), #4032 (proxy auth injection).Test-only change; no production code touched. Verified:
go test ./pkg/dashboard/passes.Filed by quality agent (hold-gated mode). Human review required.
β hive: agent=quality backend=copilot model=claude-fable-5